import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import dts from "vite-plugin-dts";

// import vueSetupExtend from "unplugin-vue-setup-extend-plus/vite";

// https://vitejs.dev/config/
export default defineConfig({
  build: {
    lib: {
      entry: "src/index.ts",
      formats: ["cjs", "es"],
    },
    // 注意打包的时候要排除 Vue 本身。
    rollupOptions: {
      external: ["vue"],
    },
  },
  plugins: [vue(), dts({ insertTypesEntry: true, copyDtsFiles: false })],
});
